namespace RM.Migrations.RoomDataContextMigrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class Initial : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Room",
                c => new
                {
                    RoomID = c.Int(nullable: false, identity: true),
                    Name = c.String(),
                    DateCreate = c.DateTime(nullable: false),
                    RoomType_RoomTypeID = c.Int(),
                })
                .PrimaryKey(t => t.RoomID)
                .ForeignKey("dbo.RoomType", t => t.RoomType_RoomTypeID)
                .Index(t => t.RoomType_RoomTypeID);

            CreateTable(
                "dbo.RoomType",
                c => new
                {
                    RoomTypeID = c.Int(nullable: false, identity: true),
                    Name = c.String(),
                })
                .PrimaryKey(t => t.RoomTypeID);

        }

        public override void Down()
        {
            DropForeignKey("dbo.Room", "RoomType_RoomTypeID", "dbo.RoomType");
            DropIndex("dbo.Room", new[] { "RoomType_RoomTypeID" });
            DropTable("dbo.RoomType");
            DropTable("dbo.Room");
        }
    }
}
